<?php
$rutaArchivo = "files" . "/" . $codigo;

$this->Paginator->options(array('update' => '#content', 'evalScripts' => true));
?>

<table id="tabla">
    <thead>
        <tr>
            <th><?php echo $this->Paginator->sort('Concepto', 'PropertyFinalReview.concepto'); ?></th>
            <th><?php echo $this->Paginator->sort('Calificación', 'PropertyFinalReview.calificacion'); ?></th>
            <th></th>
            <th></th>
        </tr>
    </thead>
    <tbody>
        <?php foreach ($PropertyFinalReviews as $PropertyFinalReview): ?>
            <?php
            $rutaDocumento = APP . "webroot" . "/" . "files" . "/" . $codigo . "/" . 'PRF-' . $codigo . '-' . $PropertyFinalReview["PropertyFinalReview"]["id"];
            ?>
            <tr>
                <td><?php echo $PropertyFinalReview['PropertyFinalReview']['concepto']; ?></td>
                <td><?php echo $PropertyFinalReview['PropertyFinalReview']['calificacion']; ?></td>
                <td><?php echo $this->Ajax->link('editar', array('controller' => 'PropertyFinalReviews', 'action' => 'edit', $PropertyFinalReview["PropertyFinalReview"]["id"]), array('class' => 'actions', 'update' => 'content', 'indicator' => 'loading')); ?></td>
                <td>
                    <?php if (file_exists($rutaDocumento . ".pdf")): ?>
                        <a href="<?php echo $rutaArchivo . "/" . "PRF-$codigo-" . $PropertyFinalReview["PropertyFinalReview"]["id"] . ".pdf" ?>" target="blank" class="actions" >Adjunto</a>
                    <?php endif; ?>
                </td>
            </tr>
        <?php endforeach; ?>
    </tbody>
</table>
<?php echo $this->Js->writeBuffer(); ?>
<br><br><br>
<?php echo $this->Ajax->link('Adicionar', array('controller' => 'PropertyFinalReviews', 'action' => 'add', $property_id), array('class' => 'actions', 'update' => 'content', 'indicator' => 'loading')); ?>
